//package com.culture.bootdemo.mq.kafka;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.kafka.clients.consumer.ConsumerRecord;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.kafka.support.Acknowledgment;
//import org.springframework.stereotype.Component;
//
///**
// * kafka 监听器
// * 对没有的topic 可设置 spring.kafka.listener.missing-topics-fatal=false ,但目前该kafka版本无此配置
// */
//@Slf4j
//@Component
//public class DemoKafkaListener {
//
//
//    @KafkaListener(topics = {KafkaContants.TOPIC_DEMO1}, groupId = KafkaContants.GROUPID_DEMO1)
//    public void onMessage(ConsumerRecord<?, ?> record, Acknowledgment ack) {
//        try {
//            log.info("DemoKafkaListener>>>>>>>>>>>>>>>>>>>>>>>>> record:{}", record);
//        } catch (Exception e) {
//            log.error("DemoKafkaListener consumer error", e);
//        } finally {
//            ack.acknowledge();//手动提交偏移量
//        }
//    }
//}
